.class public Lcom/ninesky/browser/setting/SlidingTogglePreference;
.super Lcom/ninesky/browser/setting/BasePreference;

# interfaces
.implements Lcom/ninesky/widget/f;


# instance fields
.field private f:Lcom/ninesky/widget/SlidingToggle;

.field private g:Z

.field private h:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 5

    const/4 v4, 0x1

    invoke-direct {p0, p1, p2, p3}, Lcom/ninesky/browser/setting/BasePreference;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    iput-boolean v4, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->g:Z

    new-instance v0, Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/ninesky/widget/SlidingToggle;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->getContext()Landroid/content/Context;

    move-result-object v1

    const/high16 v2, 0x42c0

    invoke-static {v1, v2}, Lcom/ninesky/a/c;->a(Landroid/content/Context;F)I

    move-result v1

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->getContext()Landroid/content/Context;

    move-result-object v2

    const/high16 v3, 0x41f0

    invoke-static {v2, v3}, Lcom/ninesky/a/c;->a(Landroid/content/Context;F)I

    move-result v2

    invoke-virtual {v0, v1, v2}, Lcom/ninesky/widget/SlidingToggle;->a(II)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v0, p0}, Lcom/ninesky/widget/SlidingToggle;->a(Lcom/ninesky/widget/f;)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v0}, Lcom/ninesky/widget/SlidingToggle;->a()Z

    move-result v0

    iput-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v0}, Lcom/ninesky/widget/SlidingToggle;->isEnabled()Z

    move-result v0

    iput-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->g:Z

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->getDependency()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->getDependency()Ljava/lang/String;

    move-result-object v0

    const-string v1, ""

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    iget v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->c:I

    sub-int/2addr v0, v4

    iput v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->c:I

    iget v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->d:I

    sub-int/2addr v0, v4

    iput v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->d:I

    const/16 v0, 0xa

    iput v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->e:I

    :cond_0
    return-void
.end method

.method private b(Z)V
    .locals 1

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    if-eq v0, p1, :cond_0

    iput-boolean p1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->persistBoolean(Z)Z

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->notifyDependencyChange(Z)V

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->callChangeListener(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v0, p1}, Lcom/ninesky/widget/SlidingToggle;->a(Z)V

    :cond_0
    return-void
.end method


# virtual methods
.method public final a(Z)V
    .locals 1

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    if-eq v0, p1, :cond_0

    iput-boolean p1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->persistBoolean(Z)Z

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->notifyDependencyChange(Z)V

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->notifyChanged()V

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->callChangeListener(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method

.method public isEnabled()Z
    .locals 1

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->g:Z

    return v0
.end method

.method protected onBindView(Landroid/view/View;)V
    .locals 3

    invoke-super {p0, p1}, Lcom/ninesky/browser/setting/BasePreference;->onBindView(Landroid/view/View;)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    iget-boolean v1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-virtual {v0, v1}, Lcom/ninesky/widget/SlidingToggle;->a(Z)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->a:Landroid/widget/TextView;

    iget-boolean v1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->g:Z

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setEnabled(Z)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->b:Landroid/widget/TextView;

    iget-boolean v1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->g:Z

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setEnabled(Z)V

    const v0, 0x1020018

    invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->getChildCount()I

    move-result v1

    if-lez v1, :cond_0

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->removeAllViews()V

    :cond_0
    iget-object v1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v1}, Lcom/ninesky/widget/SlidingToggle;->getParent()Landroid/view/ViewParent;

    move-result-object v1

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v1}, Lcom/ninesky/widget/SlidingToggle;->getParent()Landroid/view/ViewParent;

    move-result-object v1

    check-cast v1, Landroid/view/ViewGroup;

    iget-object v2, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v1, v2}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    :cond_1
    iget-object v1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    return-void
.end method

.method public onDependencyChanged(Landroid/preference/Preference;Z)V
    .locals 1

    if-eqz p2, :cond_0

    const/4 v0, 0x0

    :goto_0
    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->setEnabled(Z)V

    return-void

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method protected onGetDefaultValue(Landroid/content/res/TypedArray;I)Ljava/lang/Object;
    .locals 1

    const/4 v0, 0x1

    invoke-virtual {p1, p2, v0}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v0

    invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v0

    return-object v0
.end method

.method protected onRestoreInstanceState(Landroid/os/Parcelable;)V
    .locals 2

    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    const-class v1, Lcom/ninesky/browser/setting/SlidingTogglePreference$SavedState;

    invoke-virtual {v0, v1}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    invoke-super {p0, p1}, Lcom/ninesky/browser/setting/BasePreference;->onRestoreInstanceState(Landroid/os/Parcelable;)V

    :goto_0
    return-void

    :cond_1
    check-cast p1, Lcom/ninesky/browser/setting/SlidingTogglePreference$SavedState;

    invoke-virtual {p1}, Lcom/ninesky/browser/setting/SlidingTogglePreference$SavedState;->getSuperState()Landroid/os/Parcelable;

    move-result-object v0

    invoke-super {p0, v0}, Lcom/ninesky/browser/setting/BasePreference;->onRestoreInstanceState(Landroid/os/Parcelable;)V

    iget-boolean v0, p1, Lcom/ninesky/browser/setting/SlidingTogglePreference$SavedState;->a:Z

    invoke-direct {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->b(Z)V

    goto :goto_0
.end method

.method protected onSaveInstanceState()Landroid/os/Parcelable;
    .locals 2

    invoke-super {p0}, Lcom/ninesky/browser/setting/BasePreference;->onSaveInstanceState()Landroid/os/Parcelable;

    move-result-object v0

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->isPersistent()Z

    move-result v1

    if-eqz v1, :cond_0

    :goto_0
    return-object v0

    :cond_0
    new-instance v1, Lcom/ninesky/browser/setting/SlidingTogglePreference$SavedState;

    invoke-direct {v1, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference$SavedState;-><init>(Landroid/os/Parcelable;)V

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    iput-boolean v0, v1, Lcom/ninesky/browser/setting/SlidingTogglePreference$SavedState;->a:Z

    move-object v0, v1

    goto :goto_0
.end method

.method protected onSetInitialValue(ZLjava/lang/Object;)V
    .locals 1

    if-eqz p1, :cond_0

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->getPersistedBoolean(Z)Z

    move-result v0

    :goto_0
    invoke-direct {p0, v0}, Lcom/ninesky/browser/setting/SlidingTogglePreference;->b(Z)V

    return-void

    :cond_0
    check-cast p2, Ljava/lang/Boolean;

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    goto :goto_0
.end method

.method public setEnabled(Z)V
    .locals 2

    iput-boolean p1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->g:Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->f:Lcom/ninesky/widget/SlidingToggle;

    iget-boolean v1, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->g:Z

    invoke-virtual {v0, v1}, Lcom/ninesky/widget/SlidingToggle;->setEnabled(Z)V

    return-void
.end method

.method public shouldDisableDependents()Z
    .locals 1

    iget-boolean v0, p0, Lcom/ninesky/browser/setting/SlidingTogglePreference;->h:Z

    return v0
.end method
